/**
  ******************************************************************************
  * @file   :   .h
  * @version:
  * @author :
  * @brief  :
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright(c) . BLUEX Microelectronics.
  * All rights reserved.</center></h2>
  *
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USER_APP_H__
#define __USER_APP_H__

#ifdef __cplusplus
extern "C" {
#endif

/* includes ------------------------------------------------------------------*/
#include "bx_type_def.h"
#include "bx_msg_type_def.h"

/* config --------------------------------------------------------------------*/
#define ROLE_MASTER 0 //1:master, 0:slaver

/* exported paras ------------------------------------------------------------*/

/* exported types ------------------------------------------------------------*/

/* exported variables --------------------------------------------------------*/

/* exported constants --------------------------------------------------------*/
enum bx_msg_user{
    BXM_USER_FIRST = BXM_FIRST_USER_MSG,
    BXM_USER_TIMER_START,
    BXM_USER_TIMER_TIMEOUT,
    BXM_USER_DATA_READY,
    BXM_USER_CMD_RSP_READY,
    BXM_USER_TIMER_STOP,
};

enum bx_module_command_ids{
    BXM_MODULE_CID_BOOT = 0,
    BXM_MODULE_CID_INITIATE_CONNECTION,
    BXM_MODULE_CID_SET_PASSTHROUGH,
    BXM_MODULE_CID_REBOOT,
    BXM_MODULE_CID_QueryMac,
    BXM_MODULE_CID_SetMaster,
    BXM_MODULE_CID_SendDataReq,
    BXM_MODULE_CID_InitiateDisconnect,
    BXM_MODULE_CID_DeleteMacCorrelation,
    BXM_MODULE_CID_ReceiveThenResponse,
    BXM_MODULE_CID_SEND_REQ,
};

enum cmd_step_state{
    HEAD_F = 0,
    HEAD_B,
    CMD_ID,
    CMD_LEN,
    CMD_CONTENT,
    CHECK_SUM,
    CMD_END,
    NOT_CMD
};
/* exported macros -----------------------------------------------------------*/

/* exported functions --------------------------------------------------------*/

void user_init(void);
void user_app(void);

void set_cmd_id(enum bx_module_command_ids cid);
bool check_cmd_id(enum bx_module_command_ids cid);

bx_err_t user_msg_handle_func(s32 svc, u32 msg,u32 param0,u32 param1 );

#ifdef __cplusplus
}
#endif

#endif /* __USER_APP_H__ */

/******************** (C) COPYRIGHT BLUEX **********************END OF FILE****/
